<ion-view view-title="投保人信息">
  <ion-content class="has-footer" overflow-scroll="true" >
    <common-flow current=2 text="险种选择,投保人,被保人"></common-flow>
    <form class="common-form" name="basicInfoForm">
      <div class="list clearfix">
        <div class="item item-input item-divider item-title" ng-click="infoEntry.showBasic()">
          <div class="input-show-icon" ng-class="{'show-pic':infoEntry.showBasicInfo,'hide-pic':!infoEntry.showBasicInfo}"></div>
          <span class="input-label title">基本信息</span>
          <div ng-class="{'input-right-icon':basicInfoForm.$valid,'input-warning-icon':!basicInfoForm.$valid}"></div>
        </div>
        <div class="basic-info content">
          <div class="item item-input">
            <span class="input-label"><i class="red">*</i>姓名</span>
            <div class="item-input-wrapper">
              <input type="text" placeholder="请输入姓名" name="name" ng-model="infoEntry.name" ng-class="{'error':infoEntry.name&&basicInfoForm.name.$invalid}" name-check ng-disabled="infoEntry.nameDisabled" input-clear required auto-check autocomplete="off" sel="{{infoEntry.preName}}">
              <p class="error-tips" ng-show="basicInfoForm.name.$error.invalid">
                <i class="ion-android-alert"></i>
                {{TIPS.COMMON.USER_NAME_INVALID}}
                <span class="arrow"><span></span></span>
              </p>
              <p class="error-tips" ng-show="basicInfoForm.name.$error.length">
                <i class="ion-android-alert"></i>
                {{TIPS.COMMON.USER_NAME_LENGTH_ERROR}}
                <span class="arrow"><span></span></span>
              </p>
            </div>
          </div>
          <div class="item item-input item-select">
            <span class="input-label"><i class="red">*</i>国籍</span>
            <select name="nationality" ng-model="infoEntry.insureNationality" ng-options="node.value as node.label for node in infoEntry.insureNationalities" ng-change="infoEntry.selectbyCerType()"></select>
          </div>
          <div class="item item-input item-select">
            <span class="input-label"><i class="red">*</i>证件类型</span>
            <select name="certType" ng-model="infoEntry.certType" ng-options="node.value as node.label for node in infoEntry.certTypes" disabled required></select>
          </div>
          <div class="item item-input">
            <span class="input-label"><i class="red">*</i>证件号码</span>
            <div class="item-input-wrapper">
              <input type="text" placeholder="请输入证件号码" name="certNo" ng-model="infoEntry.certNo" id-check idtype="{{infoEntry.certType}}" ng-class="{'error':infoEntry.certNo&&basicInfoForm.certNo.$invalid}" ng-disabled="infoEntry.certNoDisabled" input-clear required>
              <p class="error-tips" ng-show="basicInfoForm.certNo.$error.length">
                <i class="ion-android-alert"></i>
                {{TIPS.COMMON.ID_LENGTH_ERROR}}
                <span class="arrow"><span></span></span>
              </p>
              <p class="error-tips" ng-show="basicInfoForm.certNo.$error.invalid">
                <i class="ion-android-alert"></i>
                {{TIPS.COMMON.ID_INVALID}}
                <span class="arrow"><span></span></span>
              </p>
              <p class="error-tips" ng-show="basicInfoForm.certNo.$error.invalid2">
                <i class="ion-android-alert"></i>
                {{TIPS.COMMON.ID_INVALID2}}
                <span class="arrow"><span></span></span>
              </p>
            </div>
          </div>
          <div class="item item-input item-select">
            <span class="input-label"><i class="red">*</i>证件有效期</span>
            <select name="certExpireType" ng-model="infoEntry.certExpireType" ng-options="node.value as node.label for node in infoEntry.certExpireTypes"></select>
          </div>
          <div class="item item-input item-date" ng-if="infoEntry.certExpireType==2">
            <span class="input-label"></span>
             <input type="date" name="certExpireDate" ng-model="infoEntry.certExpireDate" time-picker mindate="infoEntry.minStartDate" maxdate="infoEntry.maxEndDate" timetype="date" readonly required/>
            <!-- <ionic-datepicker class="item-input-wrapper" date="infoEntry.certExpireDate" min="infoEntry.minStartDate" callback="infoEntry.certExpireDateCallback">
              <input type="date" name="certExpireDate" ng-model="infoEntry.certExpireDate" readonly required>
            </ionic-datepicker> -->
          </div>
          <div class="item item-input">
            <span class="input-label"><i class="red">*</i>邮箱</span>
            <div class="item-input-wrapper">
              <input type="text" name="email" ng-model="infoEntry.email" ng-class="{'error':infoEntry.email && basicInfoForm.email.$invalid}" required email-check placeholder="请输入常用邮箱" input-clear autocomplete="false">
              <p class="error-tips" ng-show="basicInfoForm.email.$error.invalid">
                <i class="ion-android-alert"></i>
                {{TIPS.COMMON.EMAIL_INVALID}}
                <span class="arrow"><span></span></span>
              </p>
            </div>
          </div>
          <hr-radio show-sign="true" translate config="FINANCE_BASE_INFO_RADIO_SEX" choose="infoEntry.gender" name="gender"></hr-radio>
          <div class="item item-input item-date">
            <span class="input-label"><i class="red">*</i>出生日期</span>
            <input type="date" ng-model="infoEntry.birthday" time-picker mindate="infoEntry.minBir" maxdate="infoEntry.maxBir" timetype="date" readonly required/>
            <!-- <ionic-datepicker class="item-input-wrapper" date="infoEntry.birthday" min="infoEntry.holderStartDate" max="infoEntry.holderEndDate" callback="infoEntry.birthdayCallback">
              <input type="date" name="birthday" ng-model="infoEntry.birthday" readonly required ng-disabled="infoEntry.birthdayDisabled">
            </ionic-datepicker> -->
          </div>
<!--           <div class="item item-input">
            <span class="input-label"><i class="red">*</i>年龄</span>
            <input type="text" name="age" ng-model="infoEntry.age" disabled/>
          </div> -->
        </div>
      </div>
    </form>
    <form class="common-form" name="addInfoForm">
      <div class="list clearfix">
        <div class="item item-input item-divider item-title" ng-click="infoEntry.showAdd()">
          <div class="input-show-icon" ng-class="{'show-pic':infoEntry.showAddInfo,'hide-pic':!infoEntry.showAddInfo}"></div>
          <span class="input-label title">联系地址</span>
          <div ng-class="{'input-right-icon':addInfoForm.$valid,'input-warning-icon':!addInfoForm.$valid}"></div>
        </div>
        <div class="addr-info content">
          <div class="item item-input address">
            <span class="input-label"><i class="red">*</i>通讯地址</span>
            <div class="item-select item-select-next" >
              <select class="select-two-option" name="cityType"  ng-model="infoEntry.cityType" ng-options="node.value as node.label for node in infoEntry.cityTypes" ng-disabled="infoEntry.cityTypeDisabled" required></select>
            </div>
            <div class="item-select item-select-next">
              <select  class="select-two-option" name="areaType" ng-model="infoEntry.areaType" ng-options="node.value as node.label for node in infoEntry.areaTypes" ng-disabled="infoEntry.areaTypeDisabled" required></select>
            </div>
          </div>
          <div class="item item-input">
            <span class="input-label"><i class="red">*</i>详细地址</span>
            <div class="item-input-wrapper">
              <input type="text" placeholder="请输入详细地址" name="address" ng-model="infoEntry.address" ng-class="{'error':infoEntry.address&&addInfoForm.address.$invalid}" address-check ng-disabled="infoEntry.addressDisabled" required>
              <p class="error-tips" ng-show="addInfoForm.address.$error.invalid" input-clear>
                <i class="ion-android-alert"></i>
                {{TIPS.COMMON.ADDRESS_INVALID}}
                <span class="arrow"><span></span></span>
              </p>
              <p class="error-tips" ng-show="addInfoForm.address.$error.length">
                <i class="ion-android-alert"></i>
                {{TIPS.COMMON.ADDRESS_LENGTH_ERROR}}
                <span class="arrow"><span></span></span>
              </p>
            </div>
          </div>
          <div class="item item-input">
            <span class="input-label"><i class="red">*</i>通讯邮编</span>
            <div class="item-input-wrapper">
              <input type="number" placeholder="请输入邮编" name="zipcode" ng-model="infoEntry.zipcode" zipcode-check ng-class="{'error':infoEntry.zipcode&&addInfoForm.zipcode.$invalid}" ng-disabled="infoEntry.zipcodeDisabled" required>
              <p class="error-tips" ng-show="addInfoForm.zipcode.$error.invalid" input-clear>
                <i class="ion-android-alert"></i>
                {{TIPS.COMMON.ZIPCARD_INVALID}}
                <span class="arrow"><span></span></span>
              </p>
            </div>
          </div>
          <div class="item item-input item-select">
            <span class="input-label"><i class="red">*</i>居民类型</span>
            <select name="inhabitantType" ng-model="infoEntry.inhabitantType" ng-options="node.value as node.label for node in infoEntry.inhabitantTypes" ng-disabled="infoEntry.inhabitantTypeDisabled" required></select>
          </div>
          <div class="item item-input">
            <span class="input-label"><i class="red">*</i>年收入</span>
            <div class="item-input-wrapper">
              <input type="number" placeholder="请输入年收入" name="money" ng-model="infoEntry.money" money-check ng-class="{'error':infoEntry.money&&addInfoForm.money.$invalid}"  ng-disabled="infoEntry.moneyDisabled" required>
              <p class="error-tips" ng-show="addInfoForm.money.$error.invalid" input-clear>
                <i class="ion-android-alert"></i>
                {{TIPS.COMMON.MONEY_INVALID}}
                <span class="arrow"><span></span></span>
              </p>
            </div>
          </div>

          <div class="item item-input item-select">
            <span class="input-label"><i class="red">*</i>保单寄送方式</span>
            <select name="send" ng-model="infoEntry.send" ng-options="node.value as node.label for node in infoEntry.sends" ng-disabled="infoEntry.sendDisabled"></select>
          </div>
          <div class="item item-input item-select">
            <span class="input-label"><i class="red">*</i>职业</span>
            <select name="profession" ng-model="infoEntry.profession" ng-options="node.value as node.label for node in infoEntry.professions" ng-disabled="infoEntry.professionDisabled"></select>
          </div>
          <div class="item item-input">
            <span class="input-label no-warning">职业告知</span>
            <input type="text" disabled/>
          </div>
        </div>
      </div>
    </form>
    <form class="common-form" name="relationForm">
      <div class="list clearfix">
        <div class="item item-input item-divider item-title" ng-click="infoEntry.showRelationInfo()">
          <div class="input-show-icon" ng-class="{'show-pic':infoEntry.showRelation,'hide-pic':!infoEntry.showRelation}"></div>
          <span class="input-label title">关系</span>
          <div ng-class="{'input-right-icon':relationForm.$valid,'input-warning-icon':!relationForm.$valid}"></div>
        </div>
        <label class="item item-input item-select relation">
          <span class="input-label">与被保人关系</span>
          <select name="relation" ng-model="infoEntry.relation" ng-options="node.value as node.label for node in infoEntry.relations"></select>
        </label>
      </div>
    </form>
  </ion-content>
  <div class="bar bar-footer">
    <div class="button-bar">
      <button class="button" ng-click="goBack()">上一步</button>
      <button class="button button-active" ng-disabled="basicInfoForm.$invalid || addInfoForm.$invalid" ng-click="infoEntry.submit()">下一步</button>
    </div>
  </div>
</ion-view>
